package nmrworkflow.framework.functionwrappers.nmrpipe;

import nmrworkflow.framework.functionwrappers.Argument;
import nmrworkflow.framework.functionwrappers.Function;

public class NmrPipeSpWrapper extends BaseNmrPipeWrapper {
	
	private double offset;
	private double end;
	private double power;
	private double scale;
	
	public NmrPipeSpWrapper(double offset, double end, double power) {
		super();
		
		this.setOffset(offset);
		this.setEnd(end);
		this.power = power;
	}
	
	public NmrPipeSpWrapper(double offset, double end, double power, double scale) {
		super();
		
		this.setOffset(offset);
		this.setEnd(end);
		this.power = power;
		this.setScale(scale);
	}
	
	public NmrPipeSpWrapper() {
		super();
		
		this.offset = 0.39f;
		this.end = 0.98f;
		this.power = 2.0f;
	}

	@Override
	protected Function buildFunction() {
		Function sp = new Function("SP");
		sp.addArgument(new Argument("off", offset));
		sp.addArgument(new Argument("end", end));
		sp.addArgument(new Argument("pow", power));
		
		return sp;
	}

	public double getEnd() {
		return end;
	}

	public void setEnd(double end) {
		if(0 <= end && end <= 1.0)
		this.end = end;
	}

	public double getOffset() {
		return offset;
	}

	public void setOffset(double offset) {
		if(0 <= offset && offset <= 1.0)
			this.offset = offset;
	}

	public double getPower() {
		return power;
	}

	public void setPower(double power) {
		this.power = power;
	}

	public double getScale() {
		return scale;
	}

	public void setScale(double scale) {
		if(0 <= scale && scale <= 1.0)
			this.scale = scale;
	}
	
	

}
